package August;

import java.util.Scanner;
import java.util.Stack;



public class Day0825 {
    //Emacs计算器
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = Integer.parseInt(scanner.nextLine());
            String[] str = scanner.nextLine().split(" ");

            Stack<String> stack = new Stack<>();
            int sum = 0;
            for (int i = 0; i < n; i++) {
                if (!str[i].equals("+")&&!str[i].equals("-")
                        &&!str[i].equals("*")&&!str[i].equals("/"))
                    stack.push(str[i]);
                else {
                    int i1 = Integer.parseInt(stack.pop());
                    int i2 = Integer.parseInt(stack.pop());

                    if (str[i].equals("+"))
                        sum = i1+i2;
                    if (str[i].equals("-"))
                        sum = i2-i1;
                    if (str[i].equals("*"))
                        sum = i1*i2;
                    if (str[i].equals("/"))
                        sum = i2/i1;

                    stack.push(String.valueOf(sum));
                }
            }
            System.out.println(stack.pop());
        }
    }


    //五子棋
    static int[][] dp = {{0, 1}, {0, - 1}, {1, 0}, { - 1, 0}, {1, 1}, {1, - 1}, { - 1, 1}, { - 1, - 1}};
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            Character[][] map = new Character[20][20];
            for (int i = 0; i < 20; i++) {
                String s = scanner.next();
                for (int j = 0; j < 20; j++) {
                    map[i][j] = s.charAt(j);
                }
            }

            if (fun(map))
                System.out.println("Yes");
            else
                System.out.println("No");
        }
    }

    private static boolean fun(Character[][] map) {
        for (int i = 0; i < 20; i++) {
            for (int j = 0; j < 20; j++) {
                //四个方向都可以成棋
                if (map[i][j] == '*' || map[i][j] == '+'){
                    for (int k = 0; k < 8; k++) {
                        int count = 1;
                        int x = i+dp[k][0];
                        int y = j+dp[k][1];

                        while (x >= 0 && x < 20 && y >= 0 && y < 20 && map[x][y] == map[i][j]){
                            count++;
                            x = x+dp[k][0];
                            y = y+dp[k][1];
                        }
                        if (count==5)
                            return true;
                    }
                }
            }
        }
        return false;
    }
}
